package org.semanticflash.rdf.utils
{
	
	
	import com.bigflexlib.ds.container.utils.ContainerUtil;
	import com.bigflexlib.ds.container.zet.IRSet;
	import com.bigflexlib.ds.container.zet.IRWSet;
	
	import flexunit.framework.TestCase;
	
	import org.semanticflash.rdf.triple.RDFTriple;
	import org.semanticflash.rdf.values.IRI;



	/**
	 * 
	 * Base class for RDF unit tests that contains convenience
	 * methods to create char IRIs and Triples
	 * 
	 * @author aldo.bucchi@gmail.com
	 * 
	 */
	public class RDFTestBase extends BasicTestBase
	{

		protected static function assertTriples( tripleSet:IRSet, tripleChars:String ):void
		{
			if ( ! compareTriples( tripleSet, tripleChars ) )
				fail( "expected (" + tripleChars + ") but got ( " + tripleSet + " )" );
		}



//		protected static function assertSolutions( solutions:IRSet, str:String ):void
//		{
//			
//			var sols:IRSet = RDFTestingUtil.parseCharSolutions( str );
//			
//			var eq:Boolean = ContainerUtil.testEqualityByWalkingUseComparator( sols, solutions, new SimpleComparableComparator( ) );
//		
//			if ( ! eq )
//			{
//			
//				fail( "RDFGPsolutions are not equal" );
//			
//			}	
//		
//		}



		
		protected static function triples( str:String ):IRWSet
		{
			return RDFTestingUtil.parseCharTriples( str );
		
		}


		
		protected static function triple( chars:String ):RDFTriple
		{
			return RDFTestingUtil.parseCharTriple( chars );
		}
		
		
		
		
		protected static function iri( char:String ):IRI
		{
			return RDFTestingUtil.parseCharIRI( char );		
		}
		
		
		protected static function compareTriples( tripleSet:IRSet, tripleChars:String ):Boolean
		{
			return RDFTestingUtil.testTripleSetContent( tripleSet, tripleChars );
		}
		
		
	}
	
}